//
//  WormViewController.m
//  IOSApplication
//
//  Created by 麻再挺 on 2019/5/22.
//  Copyright © 2019 麻再挺. All rights reserved.
//

#import "WormViewController.h"
#import "./../../domain/Feed.h"

@interface WormViewController ()

@end

@implementation WormViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self getWormData];
}

// 获取图虫数据
- (void) getWormData {
    [[AFHTTPSessionManager manager] GET:@"https://api.tuchong.com/feed-app" parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
//        NSLog(@"%@", responseObject);
        Feed *feed = [Feed getFeedWithObj:responseObject];
        NSLog(@"---counts: %d", feed.counts);
        NSLog(@"---isHistory: %d", feed.isHistory);
        NSLog(@"---message: %@", feed.message);
        NSLog(@"---isMore: %d", feed.isMore);
        NSLog(@"---result: %@", feed.result);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"异常: %ld", error.code);
    }];
}
@end
